package com.heima.wemedia.controller.v1;

import com.baomidou.mybatisplus.extension.api.R;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.dtos.SensitiveDto;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author Cl
 * @Date 2023-2023/7/14  16:07
 * @Description 敏感词管理
 */
@RestController
@RequestMapping("/api/v1/sensitive/")
public class WmSensitiveController {

    @Autowired
    private WmSensitiveService wmSensitiveService;

    @DeleteMapping("del/{id}")
    public ResponseResult deleteSensitive(@PathVariable Integer id){
        return wmSensitiveService.deleteSensitive(id);
    }

    @PostMapping("/list")
    public ResponseResult listSensitive(@RequestBody SensitiveDto dto){
        return wmSensitiveService.listSensitive(dto);
    }

    @PostMapping("/save")
    public ResponseResult saveSensitive(@RequestBody WmSensitive sensitive){
        return wmSensitiveService.saveSensitive(sensitive);
    }

    @PostMapping("/update")
    public ResponseResult updateSensitive(@RequestBody WmSensitive sensitive){
        return wmSensitiveService.updateSensitive(sensitive);
    }

}
